/**
 * @Author: YU
 * @Date: 2021-10-24 16:26:12
 * @LastEditTime: 2021-10-24 16:26:14
 * @LastEditors: YU
 * @Description: 用户管理api
 */
import request from '@/utils/request'

// 获取用户列表数据
export function userList(params) {
  return request({
    url: 'users',
    method: 'get',
    params
  })
}

// 改变用户的状态
export function stateChanged(id, state) {
  return request({
    url: `users/${id}/state/${state}`,
    method: 'put'
  })
}

// 添加用户
export function add(data) {
  return request({
    url: 'users',
    method: 'post',
    data
  })
}
